package com.example.wechat;

import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;

import androidx.fragment.app.Fragment;


public class setragment extends Fragment implements View.OnClickListener {

    // TODO: Rename and change types of parameters
    private String mParam1;
    private String mParam2;

    private View view;



    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        view = inflater.inflate(R.layout.set_fragment, container, false);

        Button register = view.findViewById(R.id.textView10);
        Button login = view.findViewById(R.id.textView9);
        register.setOnClickListener(this);
        login.setOnClickListener(this);

        return view;
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) { // 注意这里应该使用 v.getId() 而不是 view.getId()
            case R.id.textView10:
                Intent intent1 = new Intent(getActivity(), RegisterActivity.class);
                startActivity(intent1);
                break;
            case R.id.textView9:
                Intent intent2 = new Intent(getActivity(), LoginActivity.class); // 注意这里类名的拼写应该是 LoginActivity 而不是 LoginActivety
                startActivity(intent2);
                break;
        }
    }
}